package com.itheima.pojo.query;

import lombok.Data;

@Data
public class PageQuery<T> {

    /***
     * 分装条件的
     *  如果T=User
     *      body.name
     *      body.gender
     */
    private T body;

    private Integer page;
    private Integer pageSize;
    private Integer index;

    /***
     * 计算索引
     */
    public Integer getIndex(){
        //(当前页-1）*每页条数
        return (page-1)*pageSize;
    }
}
